﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<KLS.PPDS.Web.Models.LogOnModel>" %>

<%@ Import Namespace="KLS.PPDS.Resources" %>
<%@ Import Namespace="KLS.PPDS.Utility.Html" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--This Applicaton is designed and developed by Bordingvista ltd(wwww.bordingvista.com).-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <script src="../../Scripts/jquery-1.5.1.min.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery.corner.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery.validate.js" type="text/javascript"></script>
    <script src="../../Scripts/three-column.helper.js?new Date().getTime()" type="text/javascript"></script>
    <script src="../../Scripts/buttons/buttons.js?new Date().getTime()" type="text/javascript"></script>
    <script src="../../Scripts/Login.js?new Date().getTime()" type="text/javascript"></script>

    <% Html.RenderPartial("~/Views/Shared/LocalizationTag.ascx"); %>
    <script type="text/javascript">
        $(document).ready(function () {

            $('#frm-login').validate();

            $(".login").corner("round 6px").parent().css('padding', '4px').corner("round 8px");
            $(".frame").corner("round 6px").parent().css('padding', '4px').corner("round 8px");
            $(".bannerWrapper").corner("round 6px").parent().css('padding', '4px').corner("round 8px");

            $(".contentWrapper").corner("round 6px").parent().css('padding', '4px').corner("round 8px");
            $(".loginWrapper").corner("round 6px").parent().css('padding', '4px').corner("round 8px");

            $('#UserName').focus();

            if ($('#UserName').val()) {
                $('#Password').focus();
            }

            $("#UserName").keyup(function (event) {

                //if ($('#error-message').val()) 
                {
                    $('#error-message').html('');
                    ForgetPasswordCancel();
                }

                if (event.keyCode == 13) {
                    //$("#id_of_button").click();

                    if ($('#Password').val()) {
                        Submitlogin();
                    }
                    else {
                        $('#Password').focus();
                    }
                }
            });


            $("#Password").keyup(function (event) {

                {
                    $('#error-message').html('');
                    ForgetPasswordCancel();
                }

                if (event.keyCode == 13) {
                    if ($('#Password').val()) {
                        Submitlogin();
                    }
                    else {
                        $('#UserName').focus();
                    }
                }
            });

            $("#ForgetUserName").keyup(function (event) {

                $('#error-message').html('');
                $('#ResultMessage').html('');

                if (event.keyCode == 13) {
                    if ($('#ForgetUserName').val()) {
                        ForgetPasswordSend();
                    }
                    else {
                        $('#ForgetUserName').focus();
                    }
                }
            });

        }

    );

        

    </script>    
    <title>Login</title>
    <link href="../../Content/Login.css?new Date().getTime()" rel="stylesheet" type="text/css" />
    <link href="../../Content/PPDS.css?new Date().getTime()" rel="stylesheet" type="text/css" />
    <link href="../../Content/controls.css?new Date().getTime()" rel="stylesheet" type="text/css" />
</head>
<body>
    <div class="main">
        <div class="banner frame">
            <div class="bannerWrapper">
                <img src="../../Content/images/Edit2all.png" alt="banner" />
                <img src="../../Content/images/KLS Logo.png" alt="KLS" style="float: right" />
            </div>
        </div>
        <div class="content frame ">
            <div class="contentWrapper">
                <%using (Html.BeginForm("OnLogin", "Login", FormMethod.Post, new { @Id = "frm-login" }))
                  {%>
                    <div class="login">
                        <div class="loginWrapper">
                            <table class="tbl-login" border="0" cellpadding="0" cellspacing="2px" width="100%"
                                align="center">
                                <tr>
                                    <td width="15%" align="right">
                                        <nobr> <%:CommonString.UserName + ":"%> &nbsp;</nobr>
                                    </td>
                                    <td>
                                        <%:Html.TextBoxFor(c => c.UserName, new { @class = "required",minlength="3", @maxlength = "50" })%>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <%:CommonString.Password + ":"%>
                                        &nbsp;
                                    </td>
                                    <td>
                                        <%:Html.PasswordFor(c => c.Password, new { @class = "required", minlength = "3", @maxlength = "50" })%>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right" colspan="2">
                                        <span class="error" id="error-message" style="float: right">
                                            <%:Model.ErrorMessage??"" %></span>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                    </td>
                                    <td>
                                        <div style="width: 150px;">
                                            <%:Html.DivActionLink(CommonString.Login, "", new { @class = "login-button", onclick = "Submitlogin();" })%>
                                        </div>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="2">
                                        <div id="ForgetPasswordButton" style="width: 100%;">
                                            <%:Html.DivActionLink(CommonString.ForgetPassword, "", new { @class = "forget-password-button", onclick = "ForgetPassword();" })%>
                                        </div>
                                    </td>
                                </tr>
                                <tr >
                                    <td colspan="2">
                                        <% Html.RenderPartial("~/Views/Login/ForgetPassword.ascx"); %>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="2">
                                        <div id="ResultMessage" style="text-align: left; color: Green;">
                                        </div>
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </div>
                <%
                    }%>
                <%--  <div style = " background-color:Red; min-height:300px; min-width:200px; margin:0px 10px 5px 10px;"></div>--%>
            </div>
        </div>
    </div>
    <div align="center">
        Copyright &copy; 2011 - <a href="http://www.bordingdata.dk">Bording Data A/S</a>
    </div>
</body>
</html>
